/*
 * Project: yygh-parent
 *
 * File Created at 2023/10/7
 *
 * 自定义时间格式代替DATE标签：2023-10-07 16:44:16:44
 */

import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.Test;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @author 用户名
 * @Type aa.java
 * @Desc
 * @date 2023/10/7 16:44
 */
public class aa {
    Object s1;

    public static void main(String[] args) {



        aa aa = new aa();
        System.out.println("s="+aa.s1);
        String str="nvssd";
        char c[]={'1','2'};
        aa.fun2(str,c);
        System.out.println(str);//nvssd
        System.out.println(c[0]);//2
//        byte b1=1,b2=2,b3,b6;
//        final byte b4=4,b5=6;
//        b6=b4+b5;
//        b3=b1+b2;
//        System.out.println(b3+b6);
        A a = new A();
        System.out.println(a.i);

//        a.method1();
//
//        A.method1();
//
//        A.method2();
        Double dd=1.7;


//        float f = dd/l;

                String s = "祝你考出好成绩！";
                System.out.println(s.length());
        ArrayList list=new ArrayList<>();

        Iterator it = list.iterator();
        int index = 0;
//        while (it.hasNext())
//        {
//            Object obj = it.next();
//            if (needDelete(obj))  //needDelete返回boolean，决定是否要删除
//            {
//
//                it.remove();
//                //todo delete
//            }
//            index ++;
//        }

    }
    void fun2(String aa ,char []ch){
        aa="nb";
        ch[0]='2';
        aa aa1 = new aa();
        Object o = new Object();

        System.out.println( (o instanceof Object)); //true
        System.out.println( (aa1 instanceof Object));//true
        ThreadLocal local=new ThreadLocal();
        int max=Runtime.getRuntime().availableProcessors();
        ThreadPoolExecutor thread = new ThreadPoolExecutor(
                3,
                max,
                2,
                TimeUnit.SECONDS,
                new ArrayBlockingQueue<>(3),
                Executors.defaultThreadFactory(),
//                new ThreadPoolExecutor.AbortPolicy()
//                new ThreadPoolExecutor.CallerRunsPolicy()
//                new ThreadPoolExecutor.DiscardPolicy()  //多出来的线程不执行
                new ThreadPoolExecutor.DiscardOldestPolicy()  //去找执行完的线程 如果没有抛弃任务

        );
        for (int i = 0; i < 100; i++) {
            thread.execute(()->{
                System.out.println(Thread.currentThread().getName());

            });
        }



    }

}
class BB{
     BB(){
        System.out.println("aaa");
    }
    static void func(){

    }

}

interface  cc{
    void func();
}
interface dd extends cc{}

abstract class ee {}

class CC{
    CC(String aa){};

}

class A{
    int  i;

    static  String  s;

    void  method1() {   }

    static  void  method2()  {   }

}
class GG{

}
//abstract class FF extends A,GG{
//
//
//}





/**
 * Revision history
 * -------------------------------------------------------------------------
 * <p>
 * Date Author Note
 * -------------------------------------------------------------------------
 * 2023/10/7 用户名 create
 */ 
